%
% Status : main Dynare file
%
% Warning : this file is generated automatically by Dynare
%           from model file (.mod)

if isoctave || matlab_ver_less_than('8.6')
    clear all
else
    clearvars -global
    clear_persistent_variables(fileparts(which('dynare')), false)
end
tic0 = tic;
% Save empty dates and dseries objects in memory.
dates('initialize');
dseries('initialize');
% Define global variables.
global M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info estimation_info ys0_ ex0_
options_ = [];
M_.fname = 'model';
M_.dynare_version = '4.5.7';
oo_.dynare_version = '4.5.7';
options_.dynare_version = '4.5.7';
%
% Some global variables initialization
%
global_initialization;
diary off;
diary('model.log');
M_.exo_names = 'ea';
M_.exo_names_tex = 'ea';
M_.exo_names_long = 'ea';
M_.exo_names = char(M_.exo_names, 'en');
M_.exo_names_tex = char(M_.exo_names_tex, 'en');
M_.exo_names_long = char(M_.exo_names_long, 'en');
M_.endo_names = 'yU';
M_.endo_names_tex = 'yU';
M_.endo_names_long = 'yU';
M_.endo_names = char(M_.endo_names, 'iU');
M_.endo_names_tex = char(M_.endo_names_tex, 'iU');
M_.endo_names_long = char(M_.endo_names_long, 'iU');
M_.endo_names = char(M_.endo_names, 'xiU');
M_.endo_names_tex = char(M_.endo_names_tex, 'xiU');
M_.endo_names_long = char(M_.endo_names_long, 'xiU');
M_.endo_names = char(M_.endo_names, 'PU');
M_.endo_names_tex = char(M_.endo_names_tex, 'PU');
M_.endo_names_long = char(M_.endo_names_long, 'PU');
M_.endo_names = char(M_.endo_names, 'psi_p');
M_.endo_names_tex = char(M_.endo_names_tex, 'psi\_p');
M_.endo_names_long = char(M_.endo_names_long, 'psi_p');
M_.endo_names = char(M_.endo_names, 'n0_p');
M_.endo_names_tex = char(M_.endo_names_tex, 'n0\_p');
M_.endo_names_long = char(M_.endo_names_long, 'n0_p');
M_.endo_names = char(M_.endo_names, 'gam_p');
M_.endo_names_tex = char(M_.endo_names_tex, 'gam\_p');
M_.endo_names_long = char(M_.endo_names_long, 'gam_p');
M_.endo_names = char(M_.endo_names, 'kU');
M_.endo_names_tex = char(M_.endo_names_tex, 'kU');
M_.endo_names_long = char(M_.endo_names_long, 'kU');
M_.endo_names = char(M_.endo_names, 'nU');
M_.endo_names_tex = char(M_.endo_names_tex, 'nU');
M_.endo_names_long = char(M_.endo_names_long, 'nU');
M_.endo_names = char(M_.endo_names, 'LU');
M_.endo_names_tex = char(M_.endo_names_tex, 'LU');
M_.endo_names_long = char(M_.endo_names_long, 'LU');
M_.endo_names = char(M_.endo_names, 'RbU');
M_.endo_names_tex = char(M_.endo_names_tex, 'RbU');
M_.endo_names_long = char(M_.endo_names_long, 'RbU');
M_.endo_names = char(M_.endo_names, 'rkhatsU');
M_.endo_names_tex = char(M_.endo_names_tex, 'rkhatsU');
M_.endo_names_long = char(M_.endo_names_long, 'rkhatsU');
M_.endo_names = char(M_.endo_names, 'aU');
M_.endo_names_tex = char(M_.endo_names_tex, 'aU');
M_.endo_names_long = char(M_.endo_names_long, 'aU');
M_.endo_names = char(M_.endo_names, 'cU');
M_.endo_names_tex = char(M_.endo_names_tex, 'cU');
M_.endo_names_long = char(M_.endo_names_long, 'cU');
M_.endo_names = char(M_.endo_names, 'hU');
M_.endo_names_tex = char(M_.endo_names_tex, 'hU');
M_.endo_names_long = char(M_.endo_names_long, 'hU');
M_.endo_partitions = struct();
M_.param_names = 'hU_SS';
M_.param_names_tex = 'hU\_SS';
M_.param_names_long = 'hU_SS';
M_.param_names = char(M_.param_names, 'LU_SS');
M_.param_names_tex = char(M_.param_names_tex, 'LU\_SS');
M_.param_names_long = char(M_.param_names_long, 'LU_SS');
M_.param_names = char(M_.param_names, 'PU_SS');
M_.param_names_tex = char(M_.param_names_tex, 'PU\_SS');
M_.param_names_long = char(M_.param_names_long, 'PU_SS');
M_.param_names = char(M_.param_names, 'beta_p');
M_.param_names_tex = char(M_.param_names_tex, 'beta\_p');
M_.param_names_long = char(M_.param_names_long, 'beta_p');
M_.param_names = char(M_.param_names, 'nu_p');
M_.param_names_tex = char(M_.param_names_tex, 'nu\_p');
M_.param_names_long = char(M_.param_names_long, 'nu_p');
M_.param_names = char(M_.param_names, 'alpha_p');
M_.param_names_tex = char(M_.param_names_tex, 'alpha\_p');
M_.param_names_long = char(M_.param_names_long, 'alpha_p');
M_.param_names = char(M_.param_names, 'delta_p');
M_.param_names_tex = char(M_.param_names_tex, 'delta\_p');
M_.param_names_long = char(M_.param_names_long, 'delta_p');
M_.param_names = char(M_.param_names, 'lam_p');
M_.param_names_tex = char(M_.param_names_tex, 'lam\_p');
M_.param_names_long = char(M_.param_names_long, 'lam_p');
M_.param_names = char(M_.param_names, 'chi0_p');
M_.param_names_tex = char(M_.param_names_tex, 'chi0\_p');
M_.param_names_long = char(M_.param_names_long, 'chi0_p');
M_.param_names = char(M_.param_names, 'chi1_p');
M_.param_names_tex = char(M_.param_names_tex, 'chi1\_p');
M_.param_names_long = char(M_.param_names_long, 'chi1_p');
M_.param_names = char(M_.param_names, 'rhoa_p');
M_.param_names_tex = char(M_.param_names_tex, 'rhoa\_p');
M_.param_names_long = char(M_.param_names_long, 'rhoa_p');
M_.param_names = char(M_.param_names, 'siga_p');
M_.param_names_tex = char(M_.param_names_tex, 'siga\_p');
M_.param_names_long = char(M_.param_names_long, 'siga_p');
M_.param_partitions = struct();
M_.exo_det_nbr = 0;
M_.exo_nbr = 2;
M_.endo_nbr = 15;
M_.param_nbr = 12;
M_.orig_endo_nbr = 15;
M_.aux_vars = [];
M_.Sigma_e = zeros(2, 2);
M_.Correlation_matrix = eye(2, 2);
M_.H = 0;
M_.Correlation_matrix_ME = 1;
M_.sigma_e_is_diagonal = 1;
M_.det_shocks = [];
options_.block=0;
options_.bytecode=0;
options_.use_dll=0;
M_.hessian_eq_zero = 1;
erase_compiled_function('model_static');
erase_compiled_function('model_dynamic');
M_.orig_eq_nbr = 15;
M_.eq_nbr = 15;
M_.ramsey_eq_nbr = 0;
M_.set_auxiliary_variables = exist(['./' M_.fname '_set_auxiliary_variables.m'], 'file') == 2;
M_.lead_lag_incidence = [
 0 7 0;
 0 8 0;
 0 9 0;
 0 10 0;
 0 11 0;
 0 12 0;
 0 13 0;
 1 14 0;
 2 15 0;
 3 16 0;
 4 17 0;
 5 18 0;
 6 19 0;
 0 20 22;
 0 21 23;]';
M_.nstatic = 7;
M_.nfwrd   = 2;
M_.npred   = 6;
M_.nboth   = 0;
M_.nsfwrd   = 2;
M_.nspred   = 6;
M_.ndynamic   = 8;
M_.equations_tags = {
};
M_.static_and_dynamic_models_differ = 0;
M_.exo_names_orig_ord = [1:2];
M_.maximum_lag = 1;
M_.maximum_lead = 1;
M_.maximum_endo_lag = 1;
M_.maximum_endo_lead = 1;
oo_.steady_state = zeros(15, 1);
M_.maximum_exo_lag = 0;
M_.maximum_exo_lead = 0;
oo_.exo_steady_state = zeros(2, 1);
M_.params = NaN(12, 1);
M_.NNZDerivatives = [62; -1; -1];
set(0,'DefaultFigureWindowStyle','docked')
dbstop if error
dbclear if error
M_.params( 1 ) = 1;
hU_SS = M_.params( 1 );
M_.params( 2 ) = 15;
LU_SS = M_.params( 2 );
M_.params( 2 ) = 10;
LU_SS = M_.params( 2 );
M_.params( 3 ) = 0.0125;
PU_SS = M_.params( 3 );
M_.params( 4 ) = 0.9926375361451395;
beta_p = M_.params( 4 );
M_.params( 5 ) = 2;
nu_p = M_.params( 5 );
M_.params( 6 ) = 0.33;
alpha_p = M_.params( 6 );
M_.params( 7 ) = 1;
delta_p = M_.params( 7 );
M_.params( 8 ) = 0.5;
lam_p = M_.params( 8 );
M_.params( 10 ) = 0.95;
chi1_p = M_.params( 10 );
M_.params( 9 ) = 0.025;
chi0_p = M_.params( 9 );
M_.params( 11 ) = 0.95;
rhoa_p = M_.params( 11 );
M_.params( 12 ) = 0.01;
siga_p = M_.params( 12 );
steady;
oo_.dr.eigval = check(M_,options_,oo_);
%
% SHOCKS instructions
%
M_.exo_det_length = 0;
M_.Sigma_e(1, 1) = (1)^2;
M_.Sigma_e(2, 2) = (0.6)^2;
options_.irf = 80;
options_.nograph = 1;
options_.order = 1;
var_list_ = char();
info = stoch_simul(var_list_);
save('model_results.mat', 'oo_', 'M_', 'options_');
if exist('estim_params_', 'var') == 1
  save('model_results.mat', 'estim_params_', '-append');
end
if exist('bayestopt_', 'var') == 1
  save('model_results.mat', 'bayestopt_', '-append');
end
if exist('dataset_', 'var') == 1
  save('model_results.mat', 'dataset_', '-append');
end
if exist('estimation_info', 'var') == 1
  save('model_results.mat', 'estimation_info', '-append');
end
if exist('dataset_info', 'var') == 1
  save('model_results.mat', 'dataset_info', '-append');
end
if exist('oo_recursive_', 'var') == 1
  save('model_results.mat', 'oo_recursive_', '-append');
end


disp(['Total computing time : ' dynsec2hms(toc(tic0)) ]);
if ~isempty(lastwarn)
  disp('Note: warning(s) encountered in MATLAB/Octave code')
end
diary off
